package com.mms.action.meetingroom;

import java.util.List;

import com.mms.dao.MeetingRoomManagementDao;
import com.mms.entity.MeetingRoom;
import com.opensymphony.xwork2.Action;

public class DeleteMeetingRoomAction implements Action{

	private int startPage;
	private List<MeetingRoom> meetingMessage;
	private int account;
	private int mrDelID;
	private boolean DelIsSuccess;
	
	public int getStartPage() {
		return startPage;
	}

	public void setStartPage(int startPage) {
		this.startPage = startPage;
	}

	public List<MeetingRoom> getMeetingMessage() {
		return meetingMessage;
	}

	public void setMeetingMessage(List<MeetingRoom> meetingMessage) {
		this.meetingMessage = meetingMessage;
	}

	public int getAccount() {
		return account;
	}

	public void setAccount(int account) {
		this.account = account;
	}

	public int getMrDelID() {
		return mrDelID;
	}

	public void setMrDelID(int mrDelID) {
		this.mrDelID = mrDelID;
	}

	public boolean isDelIsSuccess() {
		return DelIsSuccess;
	}

	public void setDelIsSuccess(boolean delIsSuccess) {
		DelIsSuccess = delIsSuccess;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		MeetingRoomManagementDao pmd=new MeetingRoomManagementDao();
        MeetingRoom meetingroom=new MeetingRoom();
        meetingroom.setMrId(mrDelID);
        if(pmd.DeleteMeetingRoom(meetingroom)){
        	DelIsSuccess = true;
        }
        else{
        	DelIsSuccess = false;
        }
        MeetingRoomManagementDao mrmt = new MeetingRoomManagementDao();
        meetingMessage = mrmt.getMeetingRooms(startPage);
        account = mrmt.getcount();
		return "success";
	}

}
